# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.Logging.V2.Model.DefaultSinkConfig do
  @moduledoc """
  Describes the custom _Default sink configuration that is used to override the built-in _Default sink configuration in newly created resource containers, such as projects or folders.

  ## Attributes

  *   `exclusions` (*type:* `list(GoogleApi.Logging.V2.Model.LogExclusion.t)`, *default:* `nil`) - Optional. Specifies the set of exclusions to be added to the _Default sink in newly created resource containers.
  *   `filter` (*type:* `String.t`, *default:* `nil`) - Optional. An advanced logs filter (https://cloud.google.com/logging/docs/view/advanced-queries). The only exported log entries are those that are in the resource owning the sink and that match the filter.For example:logName="projects/[PROJECT_ID]/logs/[LOG_ID]" AND severity>=ERRORTo match all logs, don't add exclusions and use the following line as the value of filter:logName:*Cannot be empty or unset when the value of mode is OVERWRITE.
  *   `mode` (*type:* `String.t`, *default:* `nil`) - Required. Determines the behavior to apply to the built-in _Default sink inclusion filter.Exclusions are always appended, as built-in _Default sinks have no exclusions.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :exclusions => list(GoogleApi.Logging.V2.Model.LogExclusion.t()) | nil,
          :filter => String.t() | nil,
          :mode => String.t() | nil
        }

  field(:exclusions, as: GoogleApi.Logging.V2.Model.LogExclusion, type: :list)
  field(:filter)
  field(:mode)
end

defimpl Poison.Decoder, for: GoogleApi.Logging.V2.Model.DefaultSinkConfig do
  def decode(value, options) do
    GoogleApi.Logging.V2.Model.DefaultSinkConfig.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.Logging.V2.Model.DefaultSinkConfig do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
